<template>
  <div>
    <el-card>
      <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
        <!-- <el-tab-pane label="未处理" name="1"></el-tab-pane> -->
        <el-tab-pane label="未完结" name="2"></el-tab-pane>
        <el-tab-pane label="已完结" name="3"></el-tab-pane>
      </el-tabs>
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <!-- <el-form-item label="状态">
            <el-select v-model="formInline.status" placeholder="请选择状态">
              <el-option
                v-for="item in statusArr"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              ></el-option>
            </el-select>
          </el-form-item> -->
        <el-form-item label="游戏名称" prop="gameId">
          <el-select
            v-model="formInline.gameId"
            placeholder="请选择游戏"
            size="small"
            clearable
            @change="selectGameType"
          >
            <el-option
              v-for="dict in gameList"
              :key="dict.id"
              :label="dict.name"
              :value="dict.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="游戏账号">
          <el-input
            placeholder="请输入游戏账号"
            v-model="formInline.accountNumber"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="上架时间">
          <el-date-picker
            v-model="saleTimeArr"
            size="small"
            format="yyyy-MM-dd"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="退还时间">
          <el-date-picker
            v-model="saleTimeArr1"
            size="small"
            format="yyyy-MM-dd"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="完结时间">
          <el-date-picker
            v-model="saleTimeArr2"
            size="small"
            format="yyyy-MM-dd"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="销售时间">
          <el-date-picker
            v-model="saleTimeArr3"
            size="small"
            format="yyyy-MM-dd"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          ></el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="getList()">搜索</el-button>
          <el-button type="info" @click="chongzhi">重置</el-button>
          <!-- <el-button type="primary" @click="addfn">新增</el-button> -->
        </el-form-item>
      </el-form>

      <div>
        <el-table :data="tableData" border style="width: 100%">
          <el-table-column prop="id" label="编号" width="88" align="center">
          </el-table-column>
          <el-table-column
            prop="goodsId"
            label="商品编号"
            width="88"
            align="center"
          >
          </el-table-column>
          <!-- <el-table-column
              prop="status"
              label="状态"
              width="180"
              align="center"
            >
              <template #default="{ row }">
                <div v-if="row.status == 1" style="color: blue">待处理</div>
                <div v-if="row.status == 2" style="color: green">已解决</div>
                <div v-if="row.status == 3" style="color: red">未解决</div>
              </template>
            </el-table-column> -->
          <el-table-column
            prop="gameName"
            label="游戏类型"
            width="150"
            align="center"
          >
          </el-table-column
          ><el-table-column
            prop="createTime"
            label="创建时间"
            width="188"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="alongDay"
            label="距离今日"
            width="188"
            align="center"
          >
            <template #default="{ row }">
              <div>
                {{ row.alongDay + "天" }}
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="channel"
            label="销售渠道"
            width="126"
            align="center"
          >
          </el-table-column
          ><el-table-column
            prop="problemType"
            label="问题类型"
            width="166"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="taskStatus"
            label="解决进度"
            width="333"
            align="center"
          >
            <template #default="{ row }">
              <el-input
                @change="changeTaskStatus(row)"
                v-model="row.taskStatus"
              ></el-input>
            </template>
          </el-table-column>
          <el-table-column
            prop="createName"
            label="转入人"
            width="126"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="overDes"
            label="完结方案"
            width="100"
            align="center"
          >
            <template #default="{ row }">
              <div>
                <!-- {{ row.overDes }} -->
                <el-input
                  @change="changeoverDes(row)"
                  v-model="row.overDes"
                ></el-input>
              </div>
            </template> </el-table-column
          ><el-table-column
            prop="accountNumber"
            label="游戏账号"
            width="126"
            align="center"
          >
          </el-table-column
          ><el-table-column
            prop="des"
            label="重要信息"
            width="333"
            align="center"
          >
          </el-table-column
          ><el-table-column
            prop="upTime"
            label="上架日期"
            width="166"
            align="center"
          >
          </el-table-column
          ><el-table-column
            prop="saleTime"
            label="销售日期"
            width="166"
            align="center"
          >
          </el-table-column
          ><el-table-column
            prop="salePrice"
            label="实收金额"
            width="126"
            align="center"
          >
          </el-table-column
          ><el-table-column
            prop="costTotalPrice"
            label="回收总金额"
            width="126"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop="costPrice"
            label="回收金额"
            width="126"
            align="center"
          >
          </el-table-column>
          <el-table-column prop="rise" label="利润" width="126" align="center">
          </el-table-column>
          <el-table-column
            prop="recyclerName"
            label="回收人"
            width="126"
            align="center"
          >
          </el-table-column>
          <el-table-column
            prop=""
            label="赔付金额（附图）"
            width="180"
            align="center"
          >
            <template #default="{ row }">
              <div @click="chakanImg(row)">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="row.repayImg"
                  fit="cover"
                ></el-image>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop=""
            label="回款金额（附图）"
            width="180"
            align="center"
          >
            <template #default="{ row }">
              <div @click="chakanImgone(row)">
                <el-image
                  style="width: 100px; height: 100px"
                  :src="row.returnImg"
                  fit="cover"
                ></el-image>
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="completionType"
            label="状态"
            width="126"
            align="center"
          >
          </el-table-column>
          <el-table-column prop="" label="亏损金额" width="126" align="center">
            <template #default="{ row }">
              <div>
                {{ row.salePrice - row.costPrice }}
              </div>
            </template>
          </el-table-column>
          <el-table-column
            v-if="formInline.afterStatus == 3"
            prop="overTime"
            label="完结日期"
            width="188"
            align="center"
          >
            <template #default="{ row }">
              <div>
                {{ row.overTime }}
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop="returnTime"
            label="还号日期"
            width="188"
            align="center"
          >
            <template #default="{ row }">
              <div>
                {{ row.returnTime }}
              </div>
            </template>
          </el-table-column>
          <el-table-column
            prop=""
            label="操作"
            fixed="right"
            width="188"
            align="center"
          >
            <template #default="{ row }">
              <el-button
                type="text"
                @click="changefnfalse(row)"
                v-if="formInline.afterStatus == 1"
                >转未完结</el-button
              >
              <el-button
                type="text"
                @click="changefn(row)"
                v-if="formInline.afterStatus == 2"
                >编辑</el-button
              >
              <!-- <el-button
                type="text"
                @click="zhuanwanjie(row)"
                v-if="formInline.afterStatus == 2"
                >转已完结</el-button
              > -->
              <el-button
                type="text"
                @click="upSale(row.goodsId)"
                v-if="formInline.afterStatus == 2"
                >上架</el-button
              >
              <el-button
                type="text"
                style="color: red"
                @click="transZhaohui(row)"
                v-if="formInline.afterStatus == 2"
                >转找回</el-button
              >
              <!-- <el-button style="color: red" type="text" @click="delfn(row)"
                  >删除</el-button
                > -->
            </template>
          </el-table-column>
        </el-table>
      </div>

      <div style="text-align: right; margin-top: 20px">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="formInline.pageNum"
          :page-sizes="[5, 10, 20, 30, 50]"
          :page-size="form.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        >
        </el-pagination>
      </div>
    </el-card>
    <!-- 新增或修改 -->
    <el-dialog
      title="售前处理"
      :visible.sync="dialogFormVisible"
      width="1000px"
      @close="close"
    >
      <el-form :inline="true" :model="form" label-width="100px">
        <el-form-item label="选择状态">
          <el-select
            style="width: 333px"
            v-model="form.completionType"
            placeholder="请选择状态"
          >
            <el-option
              v-for="item in CompletionType"
              :key="item.id"
              :label="item.name"
              :value="item.name"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="游戏">
          <el-input
            placeholder="请输入游戏"
            style="width: 333px"
            v-model="form.gameName"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="游戏账号">
          <el-input
            placeholder="请输入游戏账号"
            style="width: 333px"
            v-model="form.accountNumber"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="渠道">
          <el-input
            placeholder="请输入渠道"
            style="width: 333px"
            v-model="form.channel"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="问题类型">
          <el-input
            placeholder="请输入问题类型"
            style="width: 333px"
            v-model="form.problemType"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="进度">
          <el-input
            placeholder="请输入进度"
            style="width: 333px"
            v-model="form.taskStatus"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="售价">
          <el-input
            placeholder="请输入售价"
            style="width: 333px"
            v-model="form.price"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="销售金额">
          <el-input
            placeholder="请输入销售金额"
            style="width: 333px"
            v-model="form.salePrice"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="回收金额">
          <el-input
            placeholder="请输入回收金额"
            style="width: 333px"
            v-model="form.costPrice"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="回收其他金额">
          <el-input
            placeholder="请输入回收其他金额"
            style="width: 333px"
            v-model="form.costOtherPrice"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="回收包赔费">
          <el-input
            placeholder="请输入回收包赔费"
            style="width: 333px"
            v-model="form.costRepayPrice"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="回收总金额">
          <el-input
            placeholder="请输入回收总金额"
            style="width: 333px"
            v-model="form.costTotalPrice"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="利润">
          <el-input
            placeholder="请输入利润"
            style="width: 333px"
            v-model="form.rise"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="回款金额">
          <el-input
            placeholder="请输入回款金额"
            style="width: 333px"
            v-model="form.returnPrice"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="赔付金额">
          <el-input
            placeholder="请输入赔付金额"
            style="width: 333px"
            v-model="form.repayPrice"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="上架时间">
          <el-date-picker
            v-model="form.upTime"
            style="width: 333px"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="选择日期"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="销售日期">
          <el-date-picker
            v-model="form.saleTime"
            style="width: 333px"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="选择日期"
          ></el-date-picker>
        </el-form-item>
        <!-- <el-form-item label="完结日期">
            <el-date-picker
              v-model="form.overTime"
              style="width: 333px"
              type="datetime"
              value-format="yyyy-MM-dd HH:mm:ss"
              placeholder="选择日期"
            ></el-date-picker>
          </el-form-item> -->
        <el-form-item label="还号日期">
          <el-date-picker
            v-model="form.returnTime"
            style="width: 333px"
            type="datetime"
            value-format="yyyy-MM-dd HH:mm:ss"
            placeholder="选择日期"
          ></el-date-picker>
        </el-form-item>

        <br />
        <el-form-item label="回款图片">
          <el-upload
            :class="{ hiddenupload: titleImgList.length }"
            :action="uploadImgUrl"
            list-type="picture-card"
            :file-list="titleImgList"
            :limit="1"
            :on-preview="handlePictureCardPreview"
            :on-remove="handleRemove"
            :on-success="successhttp"
          >
            <i class="el-icon-plus"></i>
          </el-upload>
        </el-form-item>
        <el-form-item label="回款帐号">
          <el-input
            placeholder="请输入回款帐号"
            style="width: 333px"
            v-model="form.returnNo"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <br />
        <el-form-item label="赔付图片">
          <el-upload
            :class="{ hiddenupload: payList.length }"
            :action="uploadImgUrl"
            list-type="picture-card"
            :file-list="payList"
            :limit="1"
            :on-preview="handlePictureCardPreview"
            :on-remove="handleRemovePay"
            :on-success="successhttpPay"
          >
            <i class="el-icon-plus"></i>
          </el-upload>
        </el-form-item>
        <el-form-item label="赔付单号">
          <el-input
            placeholder="请输入赔付单号"
            style="width: 333px"
            v-model="form.repayNo"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <br />
        <el-form-item label="完结方案">
          <el-input
            placeholder="请输入完结方案"
            type="textarea"
            :rows="3"
            style="width: 821px"
            v-model="form.overDes"
            autocomplete="off"
          ></el-input>
        </el-form-item>
        <el-form-item label="备注">
          <el-input
            type="textarea"
            :rows="3"
            style="width: 821px"
            v-model="form.des"
            autocomplete="off"
            placeholder="请输入备注"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer" style="text-align: center">
        <el-button @click="close">取 消</el-button>
        <el-button type="primary" @click="okSure">确 定</el-button>
      </div>
      <el-dialog title="图片详情" :visible.sync="dialogVisible" append-to-body>
        <img width="100%" :src="dialogImageUrl" alt="" />
      </el-dialog>
    </el-dialog>
    <!-- 方大图片 -->
    <el-dialog title="图片详情" :visible.sync="dialogVisibleImg">
      <img style="width: 100%; height: 100%" :src="dialogImageUrlImg" alt="" />
    </el-dialog>
    <zhaohuiDialog ref="zhaohuiDialog"></zhaohuiDialog>
  </div>
</template>
    
    <script>
import gameListApi from "@/api/gameConfig/gameList"
import goodsListApi from "@/api/gameConfig/goodsList";
import zhaohuiDialog from "../AftersalesTreatment/zhaohuiDialog.vue";
import { getList, addfnList, detailfnList, editfnList, deletefnList, editData, zhuanYIwanjie } from '../../api/AftersalesTreatment/index'
export default {
  components: { zhaohuiDialog },
  data() {
    return {
      formInline: {
        pageNum: 1,
        pageSize: 10,
        afterStatus: '2',
        gameId: null,
        accountNumber: null,
        // 时间
        startUpTime: null,
        endUpTime: null,
        startReturnTime: null,
        endReturnTime: null,
        startOverTime: null,
        endOverTime: null,
        startSaleTime: null,
        endSaleTime: null,
        type: 1
      },
      gameList: [],//游戏列表
      form: {
        goodsId: null,
        gameName: null,
        gameId: null,
        channel: null,
        problemType: null,
        adminId: null,
        taskStatus: null,
        accountNumber: null,
        upTime: null,
        saleTime: null,
        price: null,
        salePrice: null,
        costPrice: null,
        costOtherPrice: null,
        costRepayPrice: null,
        costTotalPrice: null,
        rise: null,
        recyclerName: null,
        overId: null,
        overDes: null,
        overTime: null,
        returnImg: null,
        returnPrice: null,
        returnTime: null,
        repayImg: null,
        repayPrice: null,
        des: null,
        completionType: null,
        repayNo: null,
        returnNo: null,
        type: 1
      },
      statusArr: [
        { name: '未处理', id: '1' },
        { name: '未完结', id: '2' },
        { name: '已完结', id: '3' }
      ],
      CompletionType: [
        { name: '已赔付', id: '1' },
        { name: '已还号', id: '2' }
      ],
      tableData: [],
      total: 0,
      dialogFormVisible: false,
      dialogImageUrl: '',
      dialogVisible: false,
      dialogVisibleImg: false,
      dialogImageUrlImg: '',
      uploadImgUrl: '',
      titleImgList: [],
      payList: [],
      saleTimeArr: [],
      saleTimeArr1: [],
      saleTimeArr2: [],
      saleTimeArr3: [],
      gameList: [],//游戏列表
      activeName: '2'
    }
  },
  created() {
    this.uploadImgUrl = process.env.VUE_APP_BASE_API + "/upload/image";
    this.getList()
    this.getGameList()
  },
  methods: {
    // 上架商品
    upSale(id) {
      this.$prompt('请输入上架原因', '温馨提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        inputPattern: /.+/,
        inputErrorMessage: '请输入上架原因'
      }).then(({ value }) => {
        let obj = {}
        obj.problemDes = value
        obj.id = id
        goodsListApi.upGoodShop(obj).then(res => {
          this.$modal.msgSuccess(res.msg);
          this.getList()
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '取消输入'
        });
      });
    },
    // 转为找回
    transZhaohui(row) {
      this.$refs.zhaohuiDialog.open('zzh', row)
    },
    // 游戏列表
    getGameList() {
      gameListApi.getGameList().then(res => {
        this.gameList = res.rows
      })
    },
    handleClick(tab, event) {
      console.log(tab, event);
      this.formInline.pageNum = 1
      this.formInline.pageSize = 10
      this.formInline.afterStatus = tab.name
      this.form.afterStatus = tab.name
      this.getList()
    },
    //重置
    chongzhi() {
      this.formInline = {
        pageNum: 1,
        pageSize: 10,
        afterStatus: '2',
        gameId: null,
        accountNumber: null,
        // 时间
        startUpTime: null,
        endUpTime: null,
        startReturnTime: null,
        endReturnTime: null,
        startOverTime: null,
        endOverTime: null,
        startSaleTime: null,
        endSaleTime: null,
        type: 1
      }
      this.saleTimeArr = []
      this.saleTimeArr1 = []
      this.saleTimeArr2 = []
      this.saleTimeArr3 = []
      this.getList()
    },
    async getList() {
      if (this.saleTimeArr.length > 1) {
        var startDate = moment(this.saleTimeArr[0]).format("YYYY-MM-DD");
        this.formInline.startUpTime = startDate + " 00:00:00";
        var endDate = moment(this.saleTimeArr[1]).format("YYYY-MM-DD");
        this.formInline.endUpTime = endDate + " 23:59:59";
      }

      if (this.saleTimeArr1.length > 1) {
        var startDate = moment(this.saleTimeArr1[0]).format("YYYY-MM-DD");
        this.formInline.startReturnTime = startDate + " 00:00:00";
        var endDate = moment(this.saleTimeArr1[1]).format("YYYY-MM-DD");
        this.formInline.endReturnTime = endDate + " 23:59:59";
      }

      if (this.saleTimeArr2.length > 1) {
        var startDate = moment(this.saleTimeArr2[0]).format("YYYY-MM-DD");
        this.formInline.startOverTime = startDate + " 00:00:00";
        var endDate = moment(this.saleTimeArr2[1]).format("YYYY-MM-DD");
        this.formInline.endOverTime = endDate + " 23:59:59";
      }

      if (this.saleTimeArr3.length > 1) {
        var startDate = moment(this.saleTimeArr3[0]).format("YYYY-MM-DD");
        this.formInline.startSaleTime = startDate + " 00:00:00";
        var endDate = moment(this.saleTimeArr3[1]).format("YYYY-MM-DD");
        this.formInline.endSaleTime = endDate + " 23:59:59";
      }
      const res = await getList(this.formInline)
      console.log(res);
      this.tableData = res.rows
      this.total = res.total
    },
    //分页
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.formInline.pageSize = val
      this.getList()
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.formInline.pageNum = val
      this.getList()
    },
    // 新增
    addfn() {
      this.dialogFormVisible = true
    },
    //新增或修改
    async okSure() {
      const res = await editData(this.form)
      console.log(res);
      this.getList()
      this.$message.success('操作成功！')
      this.dialogFormVisible = false
    },
    close() {
      this.dialogFormVisible = false
      this.form = {
        goodsId: null,
        gameName: null,
        gameId: null,
        channel: null,
        problemType: null,
        adminId: null,
        taskStatus: null,
        accountNumber: null,
        upTime: null,
        saleTime: null,
        price: null,
        salePrice: null,
        costPrice: null,
        costOtherPrice: null,
        costRepayPrice: null,
        costTotalPrice: null,
        rise: null,
        recyclerName: null,
        overId: null,
        overDes: null,
        overTime: null,
        returnImg: null,
        returnPrice: null,
        returnTime: null,
        repayImg: null,
        repayPrice: null,
        des: null,
        completionType: null,
        repayNo: null,
        returnNo: null,
        type: 1
      }
      this.titleImgList = []
      this.payList = []
    },
    //修改
    async changefn(item) {
      this.dialogFormVisible = true
      const res = await detailfnList(item.id)
      console.log(res);
      this.form = res.data
      if (this.form.returnImg) {
        this.titleImgList.push({ url: this.form.returnImg })
      }
      if (this.form.repayImg) {
        this.payList.push({ url: this.form.repayImg })
      }
    },
    async changeTaskStatus(item) {
      let obj = {}
      obj.taskStatus = item.taskStatus
      obj.id = item.id
      const res = await editData(obj)
      console.log(res);
      this.getList()
      this.$message.success('操作成功！')
    },
    async changeoverDes(item) {
      let obj = {}
      obj.overDes = item.overDes
      obj.id = item.id
      const res = await editData(obj)
      console.log(res);
      this.getList()
      this.$message.success('操作成功！')
    },
    changefnfalse(item) {
      this.$confirm('此操作将会把该条数据转到未完结状态, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(async () => {
        const res = await editfnList(item.id)
        console.log(res);
        this.getList()
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '取消操作！'
        });
      });
    },
    zhuanwanjie(item) {
      if (!item.overDes) {
        return this.$message.warning('请输入完结方案！')
      }
      this.$confirm('此操作将会把该条数据转到已完结状态, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(async () => {
        const res = await zhuanYIwanjie(item.id)
        console.log(res);
        this.getList()
        this.$message({
          type: 'success',
          message: '操作成功!'
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '取消操作！'
        });
      });
    },
    // 删除
    async delfn(item) {
      this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(async () => {
        const res = await deletefnList(item.id)
        console.log(res);
        this.$message.success('删除成功！')
        this.getList()
        this.$message({
          type: 'success',
          message: '删除成功!'
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    //上传图片
    handleRemove(file, fileList) {
      console.log(file, fileList);
      this.titleImgList = []
      this.form.returnImg = ''
    },
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
    successhttp(response, file, fileList) {
      console.log('333', response, file, fileList);
      this.titleImgList = []
      this.form.returnImg = response.data.filePath
      this.titleImgList.push({ url: response.data.filePath })
    },
    successhttpPay(response, file, fileList) {
      console.log('333', response, file, fileList);
      this.payList = []
      this.form.repayImg = response.data.filePath
      this.payList.push({ url: response.data.filePath })
    },
    handleRemovePay(file, fileList) {
      console.log(file, fileList);
      this.payList = []
      this.form.repayImg = ''
    },
    chakanImg(item) {
      this.dialogImageUrlImg = item.repayImg;
      this.dialogVisibleImg = true;
    },
    chakanImgone(item) {
      this.dialogImageUrlImg = item.returnImg;
      this.dialogVisibleImg = true;
    },
  }
}
    </script>
    
    <style lang="scss" scoped>
::v-deep .hiddenupload .el-upload--picture-card {
  display: none;
}
</style>